package com.g8.pethospitallearnbackend.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class Flow implements Serializable {
    private String flowId;

    private String roleId;

    private String flowName;

    private Integer flowOrder;

    private Byte flowVisible;

    private List<Operation> flowOperations;

    private static final long serialVersionUID = 1L;

    public String getFlowId() {
        return flowId;
    }

    public void setFlowId(String flowId) {
        this.flowId = flowId;
    }

    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getFlowName() {
        return flowName;
    }

    public void setFlowName(String flowName) {
        this.flowName = flowName;
    }

    public Integer getFlowOrder() {
        return flowOrder;
    }

    public void setFlowOrder(Integer flowOrder) {
        this.flowOrder = flowOrder;
    }

    public Byte getFlowVisible() {
        return flowVisible;
    }

    public void setFlowVisible(Byte flowVisible) {
        this.flowVisible = flowVisible;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", flowId=").append(flowId);
        sb.append(", roleId=").append(roleId);
        sb.append(", flowName=").append(flowName);
        sb.append(", flowOrder=").append(flowOrder);
        sb.append(", flowVisible=").append(flowVisible);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Flow other = (Flow) that;
        return (this.getFlowId() == null ? other.getFlowId() == null : this.getFlowId().equals(other.getFlowId()))
            && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId()))
            && (this.getFlowName() == null ? other.getFlowName() == null : this.getFlowName().equals(other.getFlowName()))
            && (this.getFlowOrder() == null ? other.getFlowOrder() == null : this.getFlowOrder().equals(other.getFlowOrder()))
            && (this.getFlowVisible() == null ? other.getFlowVisible() == null : this.getFlowVisible().equals(other.getFlowVisible()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getFlowId() == null) ? 0 : getFlowId().hashCode());
        result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode());
        result = prime * result + ((getFlowName() == null) ? 0 : getFlowName().hashCode());
        result = prime * result + ((getFlowOrder() == null) ? 0 : getFlowOrder().hashCode());
        result = prime * result + ((getFlowVisible() == null) ? 0 : getFlowVisible().hashCode());
        return result;
    }
}